"""
八进制转十进制
"""
# from Tools.scripts.treesync import raw_input #用这个包，总会出问题的哦，
from pip._vendor.distlib.compat import raw_input

if __name__ == '__main__':
	n = 0
	p = raw_input('input a octal number:\n')
	for i in range(len(p)):
		n = n * 8 + ord(p[i]) - ord('0')
	print(n)
